package util;

import java.io.File;

public class FileDeal {
    public static boolean deleteDirectory(File dir) {
        if (dir.isDirectory()) {
            File[] children = dir.listFiles();
            if (children != null) {
                for (File child : children) {
                    boolean success = deleteDirectory(child);
                    if (!success) return false;
                }
            }
        }
        return dir.delete();
    }
}
